<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/common/head.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html>
<html lang="zh-CN">

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link rel="stylesheet" href="${resource }/css/bootstrap.css" />
		<link rel="stylesheet" href="${resource }/css/iconfont.css" />
		<link rel="stylesheet" href="${resource }/css/ystep.css">
		<link href="${resource }/css/bootstrap.css" rel="stylesheet">
		<link href="${resource }/font-awesome/css/font-awesome.css?v=4.3.0" rel="stylesheet">
		<link href="${resource }/css/plugins/iCheck/custom.css" rel="stylesheet">
		<link href="${resource }/css/animate.css" rel="stylesheet">
		
		<!--webuploader-->
		<link rel="stylesheet" type="text/css" href="${resource }/css/plugins/webuploader/webuploader.css">
		<link rel="stylesheet" type="text/css" href="${resource }/css/demo/webuploader-demo.css">
		<link href="${resource }/css/style.css?v=2.2.0" rel="stylesheet">
		<link rel="stylesheet" href="${resource }/css/notices.css" />
	</head>

	<body>

		<div class="row white-bg page-heading border-bottom wrapper">
			<div class="col-md-12">
				<div class="stepCont stepCont1">
					<!-- 菜单导航显示-->
					<div class='ystep-container ystep-lg ystep-blue'></div>
					<!-- 分页容器-->
					<div class="pageCont">
						<c:forEach items="${list}" var="step">
							<div id="page${step.stepNum}" class="stepPage">
								<c:choose>
									<c:when test="${step.stepNum==1}">
									</c:when>
								</c:choose>
							</div>
						</c:forEach>

					</div>
				</div>
				<div class="row wrapper border-bottom white-bg page-heading">
					<div class="row">
						<div class="col-lg-12">
							<div class="ibox float-e-margins">
								<div class="ibox-title">
									<h5>
															填写表格
														</h5>
									<div class="ibox-tools">
										<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
										</a>
										<a class="dropdown-toggle" data-toggle="dropdown" href="form_basic.html#"> <i class="fa fa-wrench"></i>
										</a>
										<a class="close-link"> <i class="fa fa-times"></i>
										</a>
									</div>
								</div>
								<div class="ibox-content">
									<div class="form-horizontal">
										<div class="form-group">
											<label class="col-sm-2 control-label">标题</label>

											<div class="col-sm-10">
												<input type="text" class="form-control" value="" id="detailTitle" name="detailTitle">
											</div>
										</div>
											<div class="form-group">
												<div class="ibox-title">
													<h5>内容</h5>
												</div>
													<textarea class="form-control" rows="5" id="detailInfo" name="detailInfo">
																	    	                   
										            </textarea>
											</div>
										
										<div class="row">
											<div class="col-lg-12">
												<div class="ibox float-e-margins">
													<div class="ibox-title">
														<h5>附件</h5>
														<div class="ibox-tools">
															<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
															</a>
															<a class="close-link"> <i class="fa fa-times"></i>
															</a>
														</div>
													</div>
													<div class="ibox-content">
														<div class="page-container">
															<p>您可以尝试文件拖拽，使用QQ截屏工具，然后激活窗口后粘贴，或者点击添加图片按钮，来上传附件</p>
															<div id="uploader" class="wu-example">
																<div class="queueList">
																	<div id="dndArea" class="placeholder">
																		<div id="filePicker"></div>
																		<p>或将照片拖到这里，单次最多可选300张</p>
																	</div>
																</div>
																<div class="statusBar" style="display: none;">
																	<div class="progress">
																		<span class="text">0%</span> <span class="percentage"></span>
																	</div>
																	<div class="info"></div>
																	<div class="btns">
																		<div id="filePicker2"></div>
																		<div class="uploadBtn">开始上传</div>
																	</div>
																</div>
															</div>
														</div>
													</div>
												</div>
											</div>
										</div>
										<div class="hr-line-dashed"></div>
										<div class="form-group">
											<div class="col-sm-4 col-sm-offset-2">
												<button id="save" class="btn btn-primary">保存内容</button>
												<button id="cancle" class="btn btn-white" type="button">取消</button>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

		<!-- Mainly scripts -->
		<script src="${resource }/js/jquery-2.1.1.min.js"></script>
		<script src="${resource }/js/bootstrap.js?v=3.4.0"></script>
		<script type="text/javascript" src="${resource }/js/setStep.js"></script>
		<!-- iCheck -->
		<script src="${resource }/js/plugins/iCheck/icheck.min.js"></script>
		
		<script type="text/javascript">
			$("#save").click(function() {
				var workflowId=${workflowId};
				var detailTitle=document.getElementById("detailTitle").value;
				var detailInfo=document.getElementById("detailInfo").value;
				var rs=false;
				if (detailTitle!=null&&detailTitle!=""&&detailInfo!=null&&detailInfo!="") {
					rs=true;
				} else {
					alert("标题或原由不可以为空！");
				}
				if (rs) {
					$.ajax({
						type:'POST',
						dataType: 'json',
						data:{"workflowId":workflowId,"detailTitle":detailTitle,"detailInfo":detailInfo},
						url:'saveform.do',
						success:function(data){
							if (data!="0") {
								alert("提交成功，请静候审核！");
								window.location.href="myapply.do?id="+data;
							} else {
								alert("哎呀，出错了！")
							}
						}
					})
				}
		})
		</script>
		<script>
			$(document).ready(function() {
				$('.i-checks').iCheck({
					checkboxClass: 'icheckbox_square-green',
					radioClass: 'iradio_square-green',
				});
			});
			
		</script>
		<script>
			var n = ${scounts};
			var step1 = new SetStep({
				content: '.stepCont1',
				showBtn: false,
				stepCounts: n,
				steps: ${slist},
			})
		</script>
		
		<!-- Web Uploader -->
		<script type="text/javascript">
			// 添加全局站点信息
			var BASE_URL = '${resource }/js/plugins/webuploader';
		</script>
		<script src="${resource }/js/plugins/webuploader/webuploader.min.js"></script>
		<script src="${resource }/js/demo/webuploader-demo.js"></script>

	</body>

</html>